package com.example.program.ui.activity
import com.example.program.HomeFragment
import com.example.program.adapter.mAdapt
import com.example.program.base.BaseActivity
import com.example.program.databinding.ActivityMainBinding
import com.example.program.morefragment.SecondFragment
import com.example.program.morefragment.fifthFragment
import com.example.program.morefragment.forthFragment
import com.example.program.morefragment.sixthFragment
import com.example.program.morefragment.thirdFragment
import com.google.android.material.tabs.TabLayoutMediator


class MainActivity : BaseActivity<ActivityMainBinding>() {
        override fun initUI() {
            val adapter = mAdapt(this, listOf(
                HomeFragment(),
                SecondFragment(),
                thirdFragment(),
                forthFragment(),
                fifthFragment(),
                sixthFragment()
            ))
            mBinding.viewPager.adapter = adapter

            TabLayoutMediator(mBinding)

//            // 如果需要与 TabLayout 联动
//            TabLayoutMediator(mBinding.tabLayout, mBinding.viewPager) { tab, position ->
//                tab.text = "Tab ${position + 1}"
//            }.attach()
        }

}

